package com.yuneec.droneservice.parse;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author fei.li
 * @version 1.0
 */
public class SwitchChanged implements Parcelable {

    /**
     * Hardware ID
     */
    public int hwId;
    /**
     * Old status of hardware
     */
    public int oldState;
    /**
     * New status of hardware
     */
    public int newState;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(hwId);
        dest.writeInt(oldState);
        dest.writeInt(newState);
    }

    public SwitchChanged(Parcel in) {
        hwId = in.readInt();
        oldState = in.readInt();
        newState = in.readInt();
    }

    public SwitchChanged() {
    }

    public static final Creator<SwitchChanged> CREATOR = new Creator<SwitchChanged>() {

        @Override
        public SwitchChanged createFromParcel(Parcel source) {
            return new SwitchChanged(source);
        }

        @Override
        public SwitchChanged[] newArray(int size) {
            return new SwitchChanged[size];
        }
    };

    public void readFromParcel(Parcel in) {
        hwId = in.readInt();
        oldState = in.readInt();
        newState = in.readInt();
    }
}
